package com.dhl.fin.api.dto;

import com.dhl.fin.api.common.util.DateUtil;
import com.dhl.fin.api.enums.WeekEnum;
import lombok.Data;

import java.util.Date;

/**
 * @author CuiJianbo
 * @since 2025/5/9
 */
@Data
public class NextTimeDTO {

    private String nextTime;

    private String targetTime;

    private String weekName;

    private String remark;

    public static NextTimeDTO changeToNextTime(Date nextTime, Date targetTime, String remark) {
        NextTimeDTO nextTimeDTO = new NextTimeDTO();
        nextTimeDTO.setNextTime(DateUtil.getFullTime(nextTime));
        nextTimeDTO.setTargetTime(DateUtil.getFullTime(targetTime));
        nextTimeDTO.setWeekName(WeekEnum.getWeekNameByDate(nextTime));
        nextTimeDTO.setRemark(remark);
        return nextTimeDTO;
    }

}
